/*
 * @Author: lokei
 * @Date: 2022-09-01 08:28:54
 * @LastEditors: lokei
 * @LastEditTime: 2022-09-01 08:51:35
 * @Description: 
 */
package cn.lokei.sim.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import cn.lokei.sim.SimApplication;
import cn.lokei.sim.entity.Device;

@Component
public class Heartbeat {

    @Scheduled(cron = "0/5 * * * * ?  ") // 每5秒执行一次
    public void send() {

        for (Device device : SimApplication.device_list) {
            device.heartbeat();
        }
        
    }
}
